package com.ccrfid.rmc6.entity.sys;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.sql.Timestamp;

@Entity
@Table(name = "s_account")
@JsonIgnoreProperties(value = "userPasswd", allowGetters = false, allowSetters = true)
public class AccountEntity {
    private Long id;
    private String userName;
    private String userAccount;
    private String userPasswd;
    private Integer orgId;
    private Integer enabled;
    private String remark;
    private Timestamp createTime;
    private Timestamp updateTime;
    private Long personnelId;
    private Integer cameraPermissionLevel = 1;
    private String ip;
    private Integer homePageType;

    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_name", nullable = false, length = 64)
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic
    @Column(name = "user_account", nullable = false, length = 64)
    public String getUserAccount() {
        return userAccount;
    }

    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount;
    }

    @Basic
    @Column(name = "user_passwd", nullable = false, length = 64)
    public String getUserPasswd() {
        return userPasswd;
    }

    public void setUserPasswd(String userPasswd) {
        this.userPasswd = userPasswd;
    }

    @Basic
    @Column(name = "org_id", nullable = false)
    public Integer getOrgId() {
        return orgId;
    }

    public void setOrgId(Integer orgId) {
        this.orgId = orgId;
    }

    @Basic
    @Column(name = "is_enabled", nullable = false)
    public Integer getEnabled() {
        return enabled;
    }

    public void setEnabled(Integer enabled) {
        this.enabled = enabled;
    }

    @Basic
    @Column(name = "remark", nullable = true, length = 255)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "create_time", nullable = false)
    @CreationTimestamp
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_time", nullable = false)
    @UpdateTimestamp
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "personnel_id", nullable = true)
    public Long getPersonnelId() {
        return personnelId;
    }

    public void setPersonnelId(Long personnelId) {
        this.personnelId = personnelId;
    }

    @Basic
    @Column(name = "camera_permission_level", nullable = false)
    public Integer getCameraPermissionLevel() {
        return cameraPermissionLevel;
    }

    public void setCameraPermissionLevel(Integer cameraPermissionLevel) {
        this.cameraPermissionLevel = cameraPermissionLevel;
    }

    @Basic
    @Column(name = "ip", nullable = false, length = 64)
    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    @Basic
    @Column(name = "home_page_type", nullable = true)
    public Integer getHomePageType() {
        return homePageType;
    }

    public void setHomePageType(Integer homePageType) {
        this.homePageType = homePageType;
    }

}
